<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AddAdminRoleTable extends Migrator
{
    public function up()
    {
        $table = $this->table('admin_role', ['id' => 'id', 'comment' => '用户角色表', 'engine' => 'InnoDB', '']);
        $table->addColumn('role_name', 'string', ['limit' => 60, 'default' => '', 'comment' => '角色名称'])
//            ->addColumn('is_deleted','integer',['limit' => 1, 'default' => 0, 'comment' => '是否软删除'])
            ->addTimestamps('created_at','updated_at')
            ->addColumn("deleted_at","datetime",['null' => true,'comment'=>"删除时间"])
            ->create();
    }

    public function down()
    {
        $this->table('admin_role')->drop();
    }
}
